<extend name="Public/base"/>

<block name="body">
<style>
.datetimepicker-days thead tr th{background: none !important;}
</style>
	<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>添加项目</h2>
    </div>
    <ul class="tab-nav nav">
        <li class="current"><a href="javascript:void(0)">基本信息</a></li>
		<li><a href="javascript:void(0)">关联人物</a></li>
		<li><a href="javascript:void(0)">选择工序</a></li>
		<li><a href="javascript:void(0)">其他信息</a></li>
    </ul>
    
    <form action="{:U()}" method="post" class="form-horizontal">
    <div class="tab-content">
        <div class="form-item">
            <label class="item-label">项目标题<span class="check-tips">（标题必须填写）</span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="title" value="{$vo['title']}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">项目地址</label>
            <div class="controls">
                <input type="text" class="text input-large" name="address" value="{$vo['address']}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">排序</label>
            <div class="controls">
                <input type="text" class="text input-large" name="sort" value="{$vo['sort']}">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">风格类别<span class="check-tips">（风格类别必须选择）</span></label>
            <div class="controls">
				<select name="style_id" style="width:200px;">
					<option value="">请选择类别</option>
					<volist name="style_list" id="sty">
						<option value="{$sty.id}" <?php if($vo['style_id']==$sty[id]){echo 'selected';} ?>>{$sty.title}</option>
					</volist>
				</select>
			</div>
        </div>
        <div class="form-item">
            <label class="item-label">户型类别<span class="check-tips">（户型类别必须选择）</span></label>
            <div class="controls">
                <select name="huxing_id" style="width:200px;">
                    <option value="">请选择类别</option>
                    <volist name="house_list" id="hou">
                        <option value="{$hou.id}" <?php if($vo['huxing_id']==$hou[id]){echo 'selected';} ?>>{$hou.title}</option>
                    </volist>
                </select>
            </div>
        </div>


        <div class="form-item">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </div>
        <!-- 人物 -->
    <div class="tab-content" style="display:none;">
        <div class="form-item">
            <volist name="userfz" id="vos">
                <label class="item-label">{$vos['title']}：</label>
                <div class="controls">
                    <volist name="vos['son_list']" id="son" key="kk">
                            <!--只有二级的情况-->
                            <label class="checkbox" style="<if condition='$kk eq 1'>text-indent:2em;</if>">
                                <input type="checkbox" name="person[]" value="{$son['id']}">{$son['username']}
                            </label>
                    </volist>
                </div>
            </volist>
        </div>
        <div class="form-item" style="margin-top: 50px;">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </div>
        <!-- 工序 -->
        <div class="tab-content" style="display:none;">
            <div class="form-item">

                <label class="item-label">选择工序：<span style="color: red;">（排序为数字从小到大排列！）</span></label>
                    <div class="controls" style="margin-left:20px;">
                        <volist name="gongxu_list" id="son" key="kk">
                            <div style="margin-bottom: 10px;">
                            <label class="checkbox" style="width:200px;">
                                <input type="checkbox" name="gongxu_id[]" value="{$son['id']}" />{$son['title']}
                            </label>
                            <label>排序：<input class="text" type="text" name="gxsort{$son['id']}" value="" style="width:50px;"/></label>
                            <label><span>预计完工时间：</span><input class="text xz_time" type="text" name="order_time{$son['id']}" value="" /></label>
                            </div>
                        </volist>
                    </div>

            </div>
            <div class="form-item" style="margin-top: 50px;">
                <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
                <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
        </div>
        <!-- 内容 -->
        <div class="tab-content" style="display:none;">
            <div class="form-item">
                <label class="item-label">描述：</label>
                <div class="controls">
                    <label class="textarea" style="width:400px;">
                        <textarea name="descriptions">{$vo.descriptions}</textarea>
                    </label>
                </div>
            </div>
            <div class="form-item">
                <label class="item-label">内容：</label>
                <div class="controls">
                    <label class="textarea">
                        <textarea name="content">{$vo.content}</textarea>
                        {:hook('adminArticleEdit', array('name'=>content,'value'=>$vo['content']))}
                    </label>
                </div>
            </div>
            <div class="form-item">
                <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
                <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
            </div>
        </div>
    </form>

</block>

<block name="script">
<include file="Public:datetime" />
    <script type="text/javascript">
	
		$('.tab-nav li').click(function(){
			$(this).attr('class','current')
						.siblings().attr('class','');
			var n_index=$('.tab-nav li').index(this);
				$('.tab-content').eq(n_index).show()
							 .siblings().hide();
		});
	
        //导航高亮
        highlight_subnav('{:U('Project/index')}');
		
		$('.xz_time').datetimepicker({
            format: 'yyyy-mm-dd',
            language:"zh-CN",
            minView:2,
            autoclose:true
        });


        if($("#news_navs").val()=='news'){
            $('.side-sub-menu').find('a[href="/index.php?s=/Admin/news/index.html"]').closest('li').addClass('current');
        }
    </script>
</block>
